"""评论模型"""
from sqlalchemy import Column, Text, Integer, ForeignKey
from .base import BaseModel


class Comment(BaseModel):
    """评论表模型"""
    __tablename__ = "comments"
    
    content = Column(Text, nullable=False)
    user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
    video_id = Column(Integer, ForeignKey("videos.id"), nullable=False)
    parent_id = Column(Integer, ForeignKey("comments.id"), nullable=True)
    likes = Column(Integer, default=0)
    status = Column(Integer, default=1)
